From dcffe0e2e36fcacbfefe8013d9b566234a1e4ba8 Mon Sep 17 00:00:00 2001 From: Lapo Calamandrei Date: Sat, 13 Sep 2014 12:25:46 +0200 Subject: [PATCH] Adwaita: uneven paddings on .text-button.image-button We want buttons with an icon and text to have the padding of the text-button on the label side and on the image-button on the icon side. --- gtk/resources/theme/Adwaita/_common.scss | 10 ++++++++++ gtk/resources/theme/Adwaita/gtk-contained-dark.css | 14 ++++++++++++-- gtk/resources/theme/Adwaita/gtk-contained.css | 14 ++++++++++++-- gtk/resources/theme/Adwaita/parse-sass.sh | 2 +- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/gtk/resources/theme/Adwaita/_common.scss b/gtk/resources/theme/Adwaita/_common.scss index 9bc7656b02..76fcb82320 100644 --- a/gtk/resources/theme/Adwaita/_common.scss +++ b/gtk/resources/theme/Adwaita/_common.scss @@ -506,6 +506,16 @@ $_dot_color: if($variant=='light', $selected_bg_color, padding-right: 16px; } + &.text-button.image-button { + // those buttons needs uneven horizontal padding, we want the icon side + // to have the image-button padding, while the text side the text-button + // one, so we're adding the missing padding to the label depending on + // its position inside the button + padding: 5px 8px 6px; // same as .button + GtkLabel:first-child { padding-left: 8px; } + GtkLabel:last-child { padding-right: 8px; } + } + .stack-switcher > & { // to position the needs attention dot, padding is added to the button // child, a label needs just lateral padding while an icon needs vertical diff --git a/gtk/resources/theme/Adwaita/gtk-contained-dark.css b/gtk/resources/theme/Adwaita/gtk-contained-dark.css index 05748a51fb..3bd93d5c83 100644 --- a/gtk/resources/theme/Adwaita/gtk-contained-dark.css +++ b/gtk/resources/theme/Adwaita/gtk-contained-dark.css @@ -820,6 +820,18 @@ GtkCalendar.header .button.titlebutton { GtkCalendar.header .text-button.button.titlebutton { padding-left: 16px; padding-right: 16px; } + .button.text-button.image-button, .header-bar .text-button.titlebutton.button, + .titlebar .text-button.titlebutton.button, + GtkCalendar.header .text-button.titlebutton.button { + padding: 5px 8px 6px; } + .button.text-button.image-button GtkLabel:first-child, .header-bar .text-button.titlebutton.button GtkLabel:first-child, + .titlebar .text-button.titlebutton.button GtkLabel:first-child, + GtkCalendar.header .text-button.titlebutton.button GtkLabel:first-child { + padding-left: 8px; } + .button.text-button.image-button GtkLabel:last-child, .header-bar .text-button.titlebutton.button GtkLabel:last-child, + .titlebar .text-button.titlebutton.button GtkLabel:last-child, + GtkCalendar.header .text-button.titlebutton.button GtkLabel:last-child { + padding-right: 8px; } .stack-switcher > .button > GtkLabel, .header-bar .stack-switcher > .button.titlebutton > GtkLabel, .titlebar .stack-switcher > .button.titlebutton > GtkLabel, GtkCalendar.header .stack-switcher > .button.titlebutton > GtkLabel { @@ -4167,5 +4179,3 @@ GtkCalendar.header .menuitem.titlebutton.button:selected, .list-row:selected { @define-color wm_button_active_color_b shade(#393f3f, 0.89); @define-color wm_button_active_color_c shade(#393f3f, 0.9); @define-color content_view_bg #292929; - -/*# sourceMappingURL=gtk-contained-dark.css.map */ diff --git a/gtk/resources/theme/Adwaita/gtk-contained.css b/gtk/resources/theme/Adwaita/gtk-contained.css index 75dec98fbd..20cb00da25 100644 --- a/gtk/resources/theme/Adwaita/gtk-contained.css +++ b/gtk/resources/theme/Adwaita/gtk-contained.css @@ -812,6 +812,18 @@ GtkCalendar.header .button.titlebutton { GtkCalendar.header .text-button.button.titlebutton { padding-left: 16px; padding-right: 16px; } + .button.text-button.image-button, .header-bar .text-button.titlebutton.button, + .titlebar .text-button.titlebutton.button, + GtkCalendar.header .text-button.titlebutton.button { + padding: 5px 8px 6px; } + .button.text-button.image-button GtkLabel:first-child, .header-bar .text-button.titlebutton.button GtkLabel:first-child, + .titlebar .text-button.titlebutton.button GtkLabel:first-child, + GtkCalendar.header .text-button.titlebutton.button GtkLabel:first-child { + padding-left: 8px; } + .button.text-button.image-button GtkLabel:last-child, .header-bar .text-button.titlebutton.button GtkLabel:last-child, + .titlebar .text-button.titlebutton.button GtkLabel:last-child, + GtkCalendar.header .text-button.titlebutton.button GtkLabel:last-child { + padding-right: 8px; } .stack-switcher > .button > GtkLabel, .header-bar .stack-switcher > .button.titlebutton > GtkLabel, .titlebar .stack-switcher > .button.titlebutton > GtkLabel, GtkCalendar.header .stack-switcher > .button.titlebutton > GtkLabel { @@ -4326,5 +4338,3 @@ GtkCalendar.header .menuitem.titlebutton.button:selected, .list-row:selected { @define-color wm_button_active_color_b shade(#ededed, 0.89); @define-color wm_button_active_color_c shade(#ededed, 0.9); @define-color content_view_bg #ffffff; - -/*# sourceMappingURL=gtk-contained.css.map */ diff --git a/gtk/resources/theme/Adwaita/parse-sass.sh b/gtk/resources/theme/Adwaita/parse-sass.sh index 2486480802..333bbc5c63 100755 --- a/gtk/resources/theme/Adwaita/parse-sass.sh +++ b/gtk/resources/theme/Adwaita/parse-sass.sh @@ -1,3 +1,3 @@ #!/usr/bin/bash -sass --update . +sass --update --sourcemap=none . -- 2.30.2